package cn.wolfcode.education.web.controller;

import cn.wolfcode.education.anno.PermissionName;
import cn.wolfcode.education.query.ScheduleQuery;
import cn.wolfcode.education.service.IScheduleService;
import cn.wolfcode.education.util.PageResult;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("schedule")
public class ScheduleController {

    @Autowired
    private IScheduleService scheduleService;

    @RequestMapping("")
    public String index(){
        return "schedule";
    }

    @RequestMapping("list")
    @ResponseBody
    @RequiresPermissions("schedule:list")
    @PermissionName("课程列表")
    public PageResult list(ScheduleQuery qo){
        return scheduleService.query(qo);
    }
}
